[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

1 IMGrotate

IMGrotate rotates an IMG file, either 90 or 180 degrees clockwise. We call the latter—somewhat inaccurately—a “flip”. (We haven’t needed other rotation angles, so we haven’t implemented them.)

The IMG format is an image format output by a few programs, including the one that drives the scanner we have. (Again, we haven’t needed other image formats, so we haven’t implemented them.)

Both the input and output are IMG files.

The current implementation of IMGrotate uses an extremely slow and stupid algorithm, because it was a quick hack. It would be useful to replace it with a better algorithm. @xref{Program features}, for a reference.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

1.1 IMGrotate usage

The physical construction of a source to be scanned may make it hard or impossible to end up with an upright image. But the task of extracting characters from an image is complicated by allowing for a rotated image. Hence this program to turn rotated images upright.

By default, the name of the output file is the same as the input file; both are extended with ‘.img’ if necessary. If this would result in the output overwriting the input, ‘x’ is prepended to the output name.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

1.1.1 Clockwise rotation

You specify clockwise rotation of an image with the option ‘-rotate-clockwise’. This rotates the input 90 degrees clockwise. For example, the following (an ‘h’ on its side):

      *****
     *
     *
***********

turns upright.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

1.1.2 Flip rotation

You specify “flip” rotation of an image with the option ‘-flip’. This flips the input end for end and reverses left and right, i.e., does a 180 degree rotation. For example, the following (an ‘h’ upside down and backwards):

  *  *
  *  *
  *  *
   ***
     *
     *
     *

turns upright.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

1.2 Invoking IMGrotate

This section describes the options that IMGrotate accepts. @xref{Command-line options}, for general option syntax.

The name of the main input file (@pxref{Main input file}) is called image-name below.

-flip

Rotate the input 180 degrees, i.e., flip it end for end and left to right. See section Flip rotation.

-help

Print a usage message. @xref{Common options}.

-output-file filename

Write to filename if filename has a suffix. If it doesn’t, write to ‘filename.img’, unless that would overwrite the input, in which case write to ‘xfilename.img’. By default, use image-name for filename.

-rotate-clockwise

Rotate the input 90 degrees clockwise. See section Clockwise rotation.

-verbose

Output progress reports. @xref{Common options}.

-version

Print the version number. @xref{Common options}.


[Top] [Contents] [Index] [ ? ]

About This Document

This document was generated on November 5, 2024 using texi2html 5.0.

The buttons in the navigation panels have the following meaning:

Button Name Go to From 1.2.3 go to
[ << ] FastBack Beginning of this chapter or previous chapter 1
[ < ] Back Previous section in reading order 1.2.2
[ Up ] Up Up section 1.2
[ > ] Forward Next section in reading order 1.2.4
[ >> ] FastForward Next chapter 2
[Top] Top Cover (top) of document  
[Contents] Contents Table of contents  
[Index] Index Index  
[ ? ] About About (help)  

where the Example assumes that the current position is at Subsubsection One-Two-Three of a document of the following structure:


This document was generated on November 5, 2024 using texi2html 5.0.